using System;

namespace SumerCoreDevOps.Domain.Entities
{
    /// <summary>
    /// Token黑名单实体
    /// 用于存储已撤销的JWT Token信息
    /// </summary>
    public class TokenBlacklist
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// Token的唯一标识符（JTI）
        /// </summary>
        public string TokenId { get; set; }

        /// <summary>
        /// Token字符串（部分存储，用于日志和调试）
        /// </summary>
        public string TokenHash { get; set; }

        /// <summary>
        /// Token所属用户ID
        /// </summary>
        public long UserId { get; set; }

        /// <summary>
        /// Token过期时间
        /// </summary>
        public DateTime ExpiresAt { get; set; }

        /// <summary>
        /// Token添加到黑名单的时间
        /// </summary>
        public DateTime BlacklistedAt { get; set; }

        /// <summary>
        /// Token撤销原因
        /// </summary>
        public string RevocationReason { get; set; }

        /// <summary>
        /// 关联的用户
        /// </summary>
        public User User { get; set; }
    }
}